/**
 * Created by kevin on 2017/6/27.
 */
var express = require('express');
var router = express.Router();
var qr_image = require('qr-image');

router.get('/', function(req, res, next) {
    var url = req.query.url;
    var text = req.query.text;
    var value = url || text;
    var temp_qrcode = qr_image.image(value);
    res.type('png');
    temp_qrcode.pipe(res);
});

module.exports = router;
